Learning Objectives

After completing this lesson, you'll be able to:

In this lesson, you will:

Learning Objectives

After completing this lesson, you'll be able to:

In this lesson, you will:

Resources

If you're taking a live Safe Software-hosted training course or using an on-demand lab for this course, we've already imported the content for this lesson into your FME Flow.
If you're completing this lesson with your own FME Flow, you must import the starting project with the content into your FME Flow.
See FME Flow Authoring: Instructions to Import the Starting Project for directions to import the project to your own FME Flow.  

Advanced Workspace Processing with Flow Apps

Currently, FME Flow limits workspace apps to one workspace and one service at a time. In specific scenarios, you may want to run a workspace app with multiple services, run multiple workspaces in sequence, or conditionally run other FME workflows depending on results from your app. FME Flow offers numerous features that let you link workspaces and apps for seamless processing. 

Feature Common Functions How to set it up

Linked Workspace Apps

Run one workspace through two services by chaining two apps.

Pass the values a user entered in one app straight into the next, through the app URL.

On the receiving app, turn on Enable Dynamic Parameters and Enable URL-Based Configuration, and list what the URL may set under Allowed Parameters.

Turn on Run Immediately so it runs without a second form.

Build the link in the first workspace's output, with the value URL-encoded.

Automation Apps

Run multiple workspaces in sequence or in parallel.

Run workspaces conditionally based on results or data from previous workspaces or app inputs.

Trigger additional workflows with FME Flow System Events and Topics external actions.

Build an automation that starts with a Manual Trigger — an automation without one cannot be run from an app.

Create the app from Flow Apps > Automation Apps tab.

See Job Orchestration in Automations or Create No-Code Web Apps for training content on how to create automation apps.

FME Flow REST API

Make API calls to FME Flow to retrieve data and information.

Trigger and run FME workflows from external applications or from workspaces.

Link within workspace apps to run other workflows or send data to FME Flow.

Find the endpoint in the REST API documentation at /fmeapiv4/docs/index.html on your FME Flow.

Call it from the workspace with an HTTPCaller or OpenAPICaller, referencing a user parameter for anything the app user chooses.

Webhook URLs

Run workspaces programmatically from third-party applications, web browsers, or other workspaces.

Link from workspace app results to run a second workspace with app user inputs, or with a different service than the app.

Configure the workspace on the Run Workspace page, then open Workspace Actions and select Create Webhook.

Set the parameters the webhook will run with, then click Create.

Copy the URL and its token straight away — it is shown only once.

Triggering Workflows with the FME Flow REST API

You can use the FME Flow REST API to run or enable additional workflows on FME Flow from within a workspace that is running as an app. First, locate the API endpoint you wish to use in the FME Flow REST API documentation, which you can find at http://<your FME Flow host>/fmeapiv4/docs/index.html. For example, to enable or disable a schedule on your FME Flow from a workspace app, you would use the PUT /schedules/{id}/enabled endpoint. 

The endpoint takes a single parameter: the schedule ID. You can configure your workspace to enable or disable a single schedule, or use a user parameter to select which schedule to enable or disable in your FME Flow. Create a Choice parameter to select the schedule name, and have it reference the ID. 

Then, reference the parameter from the transformer that makes the API request in your workspace. The most common transformers for this purpose are the HTTPCaller and OpenAPICaller. 

From a workspace app, the user sees only the schedule names in the Choice parameter. When they run the app, the workspace calls FME Flow to enable or disable the selected schedule. 

Webhook URLs to Run Workspaces

A Webhook URL runs a workspace directly, without an app in front of it. You configure the workspace on the Run Workspace page, then open Workspace Actions and select Create Webhook instead of clicking Run.

FME Flow prompts you to configure the webhook and its parameters. When you change a parameter, the URL updates to reflect it. You can always use the parameters to run the workspace set here, or you may alter the URL directly and use the webhook URL to run the workspace with different parameter selections. 

FME Flow shows two URLs: one with an authorization header and one with a query string, along with a token that grants permission to run the workspace. This is your only chance to download that information, so copy it before you leave the page.

Because a webhook runs a workspace rather than an app, it is the right tool when no app is involved at all: a third-party system, a scheduled script, or another workspace that needs to start this one. Its parameter values are fixed when you create it, so each distinct set of values is a separate webhook.

Note

For linking one app to another, an app URL is usually the better choice. A webhook fixes its parameters when you create it and carries a token; an app URL takes its values at the moment it is opened, and what it may set is governed by Allowed Parameters.

Exercise

Note

The content used in this lesson builds on the previous lesson. To do this exercise, continue with your workspace app from the exercise in Set Parameters with Query Strings. 

Frank, a GIS Administrator, has a download app that takes a neighborhood from its URL. Colleagues still ask for the wrong neighborhood, download the data, and then ask again. He wants them to see the licenses first and download only once they know what they want, which means reaching two transformation services from one FME Flow workflow.

In this exercise, you will:

1) Open Starting Workspace

2) Add App URL to HTMLReportGenerator

 

<p><a href="http://localhost/fmeserver/apps/vendor-businesses-data-download?dynamicParameterData=%5B%7B%22name%22%3A%22NEIGHBORHOOD%22%2C%22defaultValue%22%3A%22West%20End%22%7D%5D">Download Excel Sheet</a></p>

3) Publish the Workspace with Both Services

Publish to FME Flow
Once you build your workflows in FME Workbench, you need to transfer them to FME Flow through the publishing process. To publish a workspace to FME Flow, you need to complete all the steps in the publishing wizard.  
1. Click Publish in the FME Flow Connection toolbar. The publishing wizard window will open.
2. Confirm your FME Flow Connection lists the correct connection and successfully connects to your FME Flow.
3. Select a repository to house the workspace on FME Flow from the drop-down options. To create a new repository, click New and enter its details. 
4. Optionally, you may Upload data files to publish the workspace's source data files to FME Flow along with the workspace. You can control which files to upload from the Select Files... option. 
5. Click Next to move on to the next step.
6. If your workspace uses any connections, the Upload Connections section will appear. You can select whether to publish the connections to FME Flow. 
7. Register Services is the last publishing step. Select the transformation services you want your workspace to be able to use on FME Flow. 
8. Click Publish. 
9. The translation log generates a summary of publishing and provides a direct link to open the workspace on FME Flow. 
For more information on the FME Flow services and publishing to FME Flow, see Deploy Workspaces on FME Flow. 

4) Create Workspace App

5) Test Data Preview and Download Apps

 

You've now built two FME Flow apps, one to preview the data, and one to download the data immediately. You can use multiple FME Flow transformation services from a single workspace app form with a one-button click from the data streaming output HTML. This workflow will help Frank save time fulfilling food vendor business license data, while allowing his colleagues to make selections and preview their data before downloading it. 

Resources

If you're taking a live Safe Software-hosted training course or using an on-demand lab for this course, we've already imported the content for this lesson into your FME Flow.
If you're completing this lesson with your own FME Flow, you must import the starting project with the content into your FME Flow.
See FME Flow Authoring: Instructions to Import the Starting Project for directions to import the project to your own FME Flow.  

Advanced Workspace Processing with Flow Apps

Currently, FME Flow limits workspace apps to one workspace and one service at a time. In specific scenarios, you may want to run a workspace app with multiple services, run multiple workspaces in sequence, or conditionally run other FME workflows depending on results from your app. FME Flow offers numerous features that let you link workspaces and apps for seamless processing. 

Feature Common Functions How to set it up

Linked Workspace Apps

Run one workspace through two services by chaining two apps.

Pass the values a user entered in one app straight into the next, through the app URL.

On the receiving app, turn on Enable Dynamic Parameters and Enable URL-Based Configuration, and list what the URL may set under Allowed Parameters.

Turn on Run Immediately so it runs without a second form.

Build the link in the first workspace's output, with the value URL-encoded.

Automation Apps

Run multiple workspaces in sequence or in parallel.

Run workspaces conditionally based on results or data from previous workspaces or app inputs.

Trigger additional workflows with FME Flow System Events and Topics external actions.

Build an automation that starts with a Manual Trigger — an automation without one cannot be run from an app.

Create the app from Flow Apps > Automation Apps tab.

See Job Orchestration in Automations or Create No-Code Web Apps for training content on how to create automation apps.

FME Flow REST API

Make API calls to FME Flow to retrieve data and information.

Trigger and run FME workflows from external applications or from workspaces.

Link within workspace apps to run other workflows or send data to FME Flow.

Find the endpoint in the REST API documentation at /fmeapiv4/docs/index.html on your FME Flow.

Call it from the workspace with an HTTPCaller or OpenAPICaller, referencing a user parameter for anything the app user chooses.

Webhook URLs

Run workspaces programmatically from third-party applications, web browsers, or other workspaces.

Link from workspace app results to run a second workspace with app user inputs, or with a different service than the app.

Configure the workspace on the Run Workspace page, then open Workspace Actions and select Create Webhook.

Set the parameters the webhook will run with, then click Create.

Copy the URL and its token straight away — it is shown only once.

Triggering Workflows with the FME Flow REST API

You can use the FME Flow REST API to run or enable additional workflows on FME Flow from within a workspace that is running as an app. First, locate the API endpoint you wish to use in the FME Flow REST API documentation, which you can find at http://<your FME Flow host>/fmeapiv4/docs/index.html. For example, to enable or disable a schedule on your FME Flow from a workspace app, you would use the PUT /schedules/{id}/enabled endpoint. 

The endpoint takes a single parameter: the schedule ID. You can configure your workspace to enable or disable a single schedule, or use a user parameter to select which schedule to enable or disable in your FME Flow. Create a Choice parameter to select the schedule name, and have it reference the ID. 

Then, reference the parameter from the transformer that makes the API request in your workspace. The most common transformers for this purpose are the HTTPCaller and OpenAPICaller. 

From a workspace app, the user sees only the schedule names in the Choice parameter. When they run the app, the workspace calls FME Flow to enable or disable the selected schedule. 

Webhook URLs to Run Workspaces

A Webhook URL runs a workspace directly, without an app in front of it. You configure the workspace on the Run Workspace page, then open Workspace Actions and select Create Webhook instead of clicking Run.

FME Flow prompts you to configure the webhook and its parameters. When you change a parameter, the URL updates to reflect it. You can always use the parameters to run the workspace set here, or you may alter the URL directly and use the webhook URL to run the workspace with different parameter selections. 

FME Flow shows two URLs: one with an authorization header and one with a query string, along with a token that grants permission to run the workspace. This is your only chance to download that information, so copy it before you leave the page.

Because a webhook runs a workspace rather than an app, it is the right tool when no app is involved at all: a third-party system, a scheduled script, or another workspace that needs to start this one. Its parameter values are fixed when you create it, so each distinct set of values is a separate webhook.

Note

For linking one app to another, an app URL is usually the better choice. A webhook fixes its parameters when you create it and carries a token; an app URL takes its values at the moment it is opened, and what it may set is governed by Allowed Parameters.

Exercise

Note

The content used in this lesson builds on the previous lesson. To do this exercise, continue with your workspace app from the exercise in Set Parameters with Query Strings. 

Frank, a GIS Administrator, has a download app that takes a neighborhood from its URL. Colleagues still ask for the wrong neighborhood, download the data, and then ask again. He wants them to see the licenses first and download only once they know what they want, which means reaching two transformation services from one FME Flow workflow.

In this exercise, you will:

1) Open Starting Workspace

2) Add App URL to HTMLReportGenerator

 

<p><a href="http://localhost/fmeserver/apps/vendor-businesses-data-download?dynamicParameterData=%5B%7B%22name%22%3A%22NEIGHBORHOOD%22%2C%22defaultValue%22%3A%22West%20End%22%7D%5D">Download Excel Sheet</a></p>

3) Publish the Workspace with Both Services

Publish to FME Flow
Once you build your workflows in FME Workbench, you need to transfer them to FME Flow through the publishing process. To publish a workspace to FME Flow, you need to complete all the steps in the publishing wizard.  
1. Click Publish in the FME Flow Connection toolbar. The publishing wizard window will open.
2. Confirm your FME Flow Connection lists the correct connection and successfully connects to your FME Flow.
3. Select a repository to house the workspace on FME Flow from the drop-down options. To create a new repository, click New and enter its details. 
4. Optionally, you may Upload data files to publish the workspace's source data files to FME Flow along with the workspace. You can control which files to upload from the Select Files... option. 
5. Click Next to move on to the next step.
6. If your workspace uses any connections, the Upload Connections section will appear. You can select whether to publish the connections to FME Flow. 
7. Register Services is the last publishing step. Select the transformation services you want your workspace to be able to use on FME Flow. 
8. Click Publish. 
9. The translation log generates a summary of publishing and provides a direct link to open the workspace on FME Flow. 
For more information on the FME Flow services and publishing to FME Flow, see Deploy Workspaces on FME Flow. 

4) Create Workspace App

5) Test Data Preview and Download Apps

 

You've now built two FME Flow apps, one to preview the data, and one to download the data immediately. You can use multiple FME Flow transformation services from a single workspace app form with a one-button click from the data streaming output HTML. This workflow will help Frank save time fulfilling food vendor business license data, while allowing his colleagues to make selections and preview their data before downloading it.